﻿@model $prjsn$.Common.Models.Services.HowTos.IComplexEntityModel

@this.CreateForm()

@AddControls(
    new Fieldset("w32p mh100 ", Str.Business.Common.Identification)
    {
        new DefinitionList
        {
            new TextOrInput(true).SetSourceProperty(() => Model.Item.ID),
            new TextOrInput().SetSourceProperty(() => Model.Item.Code),
            new TextOrInput().SetSourceProperty(() => Model.Item.ShortName),
        }
    },
    new Fieldset("w32p mh100 ", "File")
    {
        new DefinitionList(PercentForLabel.p00)
        {
            new DefinitionListItem()
            .SetLabel("Image")
            .AddControls(
                new AnchorOrFile()
                    .SetSourceProperty(() => Model.Item.Image)
                    .SetDetailAction("Image")
                    .SetText(Model.Item.ImageFileName)
            ),
        }
    },
    new Fieldset("w32p mh100 ", "SimpleEntity")
    {
        new DefinitionList(PercentForLabel.p50)
        {
            new AsyncComboBox().SetSourceProperty(() => Model.Item.SimpleCombo),

            new AsyncComboView().SetSourceProperty(() => Model.Item.SimpleAsync),

            new AsyncComboView()
                .SetSourceProperty(() => Model.Item.SimpleAuto)
                .SetAutoCompleteAction(Str.Actions.Special.AutoComplete),
        }
    })

@RenderControl("Services/HowTos/ComplexEntity/DetailValueTypes.cshtml")

@AddControls(
    new Fieldset("w40p mh50 ", "VeryLongName")
    {
        new DefinitionList(PercentForLabel.p00)
        {
            new DefinitionListItem()
            .HideLabel(true)
            .AddControls(
            new TextOrTextArea()
                .SetSourceProperty(() => Model.Item.VeryLongName)
                .SetCssClassName("h50")
            ),
        }
    })

@this.CloseForm()